package ollama.ai.two.controller;

import jakarta.annotation.Resource;
import ollama.ai.two.service.TextService;
import org.springframework.web.bind.annotation.*;


/**
 * @Auther:Liu
 * @Testname:TextController
 * @Date:2025/9/23 19:11
 */
@RestController
@RequestMapping("/save_text")
public class TextController {
    @Resource
    private TextService textService;

    @PostMapping
    public String saveText(String text) {
        textService.textAddMax(text);
        return "添加成功";
    }

    @DeleteMapping
    public String textDelete(String id) {
        textService.textDelete(id);
        return "删除成功";
    }

    @GetMapping
    String textFind(String key){
        textService.textFind(key);
        return "查找成功";
    }
}
